//
//  DetailTableViewController.m
//  Baby
//
//  Created by YC on 2017/8/8.
//  Copyright © 2017年 YC. All rights reserved.
//

#import "DetailTableViewController.h"

@interface DetailTableViewController ()

@end

@implementation DetailTableViewController

+ (instancetype)getInstance {
    
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main"
                                                         bundle:nil];
    id vc = [storyboard instantiateViewControllerWithIdentifier:@"DetailTableViewController"];
    
    return vc;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupUI];
    [self initializationContent];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void)setupUI {
    self.tableView.tableFooterView = [[UIView alloc] init];

    self.remarkTextView.layer.borderWidth = 0.5;
    self.remarkTextView.layer.borderColor = [[UIColor lightGrayColor] CGColor];
    self.remarkTextView.layer.cornerRadius = 5;
    self.remarkTextView.layer.masksToBounds = true;
}

- (void)initializationContent {
    NSDateFormatter *fm = [[NSDateFormatter alloc] init];
    fm.dateFormat = @"yyyy-MM-dd HH:mm:ss";
    
    self.dateTextField.text = [fm stringFromDate:self.list.time];
    self.timesTextField.text = [NSString stringWithFormat:@"%d",self.list.times];
    self.remarkTextView.text = self.list.remark;
}


@end
